<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -->
<!DOCTYPE html>
<html lang="zh-cn">
<%@ include file="/WEB-INF/view-system/include/contentTaglib.jsp"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link href="${ctx}/static-system/css/dataexport/caiwuRepayRecord.css" rel="stylesheet" type="text/css"/>
	<script src="${ctx}/static-system/js/dataexport/caiwuRepayRrecord.js" type="text/javascript"></script>
	<title>对公正常还款（财务操作）</title>
</head>
<body>

<!--修改对公还款的状态-->
<tags:ajax id="caiwuEditAjax" url="${ctx }/sms/register/caiwuEdit" type="post"
	contentType="application/x-www-form-urlencoded"
	autoSend="false" onSuccess="upRepaySuc"/>
<!-- 根据id查询图片并显示 -->
<tags:ajax id="showPicAjax" url="${ctx }/sms/fileUtil/showImgs" type="post"
	contentType="application/x-www-form-urlencoded"
	autoSend="false" />
<!-- 用于查找是否有未入账记录 -->
<tags:ajax id="unrecordedAjax" url="${ctx }/sms/pcl/unrecordDetail/${recodrVo.loan_no}" type="post"
	autoSend="false" onSuccess="unrecordAjaxSucc" />
	
	
<tags:dialogBody className="m-narrow">
<form id='settleWithholdFinanceFrm' method='post' class='m-cust'>
	<div class='form-horizontal'>
		<div class="form-group" style="display:none;">
			<div class="col-sm-3 ">
				<label class="m-label" for="pubrepay_id">id：</label>
			</div>
			<div class="col-md-7 comD">
				<input id="pubrepay_id" name="pubrepay_id" value="${recodrVo.pubrepay_id}" class="form-control m-input" readonly>
			</div>
		</div>
		<div class="form-group row">
		    <div class="col-sm-6 col-md-6">
			    <div class="col-sm-4 col-md-4">
				    <label class="m-label" for="loan_no">贷款编号：</label>
			    </div>
			    <div class="col-sm-8 col-md-8">
				    <input id="loan_no" name="loan_no" value="${recodrVo.loan_no}" class="form-control m-input" readonly>
			    </div>
			</div>
			<div class="col-sm-6 col-md-6">
				<div class="col-sm-4 col-md-4">
					<label class="m-label" for="customerName">客户姓名：</label>
				</div>
				<div class="col-sm-8 col-md-8">
					<input id="customerName" name="customerName" value="${customerName}" class="form-control m-input" readonly>
				</div>
			</div>
		</div>
		<div class="form-group row">
			<div class="col-sm-6 col-md-6"> 
				<div class="col-sm-4 col-md-4">
					<label class="m-label" for="chanName">渠道：</label>
				</div>
				<div class="col-sm-8 col-md-8">
					<input id="chanName" name="chanName" value="${chanName}" class="form-control m-input" readonly>
				</div>
		    </div>
		    <div class="col-sm-6 col-md-6"> 
				<div class="col-sm-4 col-md-4">
					<label class="m-label" for="dk_status">状态：</label>
				</div>
				<div class="col-sm-8 col-md-8">
<!-- 				<select class="form-control m-input" id="dk_status" name="dk_status"> -->
<!-- 			        <option value="038002" selected="selected">未还</option> -->
<!-- 			        <option value="038003" >已还</option> -->
<!-- 			        <option value="038001" >取消</option> -->
<!-- 			    </select> -->
					<tags:dropcode id="dk_status" codeType="repayDgStatus" className="form-control"
						name="dk_status" showSelectAll="true" onSuccess="caiwuState"/>
				</div>
		    </div>
		</div>
		<div class="form-group row">
			<div class="col-sm-6 col-md-6"> 
				<div class="col-sm-4 col-md-4">
					<label class="m-label" for="repay_total_yh">应还总金额：</label>
				</div>
				<div class="col-sm-8 col-md-8">
					<input id=repay_total_yh name="repay_total_yh" value="${recodrVo.repay_total_yh}" class="form-control m-input" readonly>
				</div>
		    </div>
			<div class="col-sm-6 col-md-6"> 
				<div class="col-sm-4 col-md-4">
					<label class="m-label" for="dk_type">还款类型：</label>
				</div>
				<div class="col-sm-8 col-md-8">
					<select class="form-control m-input" id="dk_type" name="dk_type" >
				        <option value="028003" selected="selected" >正常还款</option>
				    </select>
				</div>
		    </div>
		</div>
		<div class="form-group row">
			<div class="col-sm-6 col-md-6"> 
				<div class="col-sm-4 col-md-4">
					<label class="m-label" for="channelType">交易时间：</label>
				</div>
				<div class="col-sm-8 col-md-8">
					<tags:datepicker dateFormat="yyyy-MM-dd HH:ii" name="tran_time" 
						dateType="datetime" id="tran_time" value="${recodrVo.tran_time}"/>
				</div>
		    </div>
			<div class="col-sm-6 col-md-6"> 
				<div class="col-sm-4 col-md-4">
					<label class="m-label" for="tran_Serial_no">交易流水号：</label>
				</div>
				<div class="col-sm-8 col-md-8">
					<input name="tran_Serial_no" id="tran_serial_no" value="${recodrVo.tran_Serial_no}" class="form-control m-input" disabled>
				</div>
		    </div>
		</div>
		<div class="form-group row">
			<div class="col-sm-6 col-md-6"> 
				<div class="col-sm-4 col-md-4">
					<label class="m-label" for="tran_amt">交易金额：</label>
				</div>
				<div class="col-sm-8 col-md-8">
					<input name="tran_amt" id="tran_amt" value="${recodrVo.tran_amt}" class="form-control m-input" >
				</div>
		    </div>
			<div class="col-sm-6 col-md-6"> 
				<div class="col-sm-4 col-md-4">
					<label class="m-label" for="do_repay_num">执行期数：</label>
				</div>
				<div class="col-sm-8 col-md-8">
					<input name="do_repay_num" id="do_repay_num" value="${recodrVo.do_repay_num}" class="form-control m-input" disabled>
				</div>
		    </div>
		</div>
		<div class="form-group row">
			<div class="col-sm-6 col-md-6"> 
				<div class="col-sm-4 col-md-4">
					<label class="m-label" for="do_repay_num">还款总期数：</label>
				</div>
				<div class="col-sm-8 col-md-8">
					<input name="plan_total_num" id="plan_total_num" value="${recodrVo.plan_total_num}" class="form-control m-input" disabled>
				</div>
		    </div>
			<div class="col-sm-6 col-md-6" style="display:none"> 
				<div class="col-sm-4 col-md-4">
					<label class="m-label" for="pubrepay_status">处理状态：</label>
				</div> 
				<div class="col-sm-8 col-md-8">
					<input id="pubrepay_status" name="pubrepay_status" class="form-control m-input" readonly>
				</div>
		    </div>
			<div class="col-sm-6 col-md-6" style="display:none"> 
				<div class="col-sm-4 col-md-4">
					<label class="m-label" for="operater_type">操作员类型：</label>
				</div> 
				<div class="col-sm-8 col-md-8">
					<input id="operater_type" name="operater_type" class="form-control m-input" value="04" readonly>
				</div>
		    </div>
		</div>
		<div class="form-group row">
			<div class="col-sm-12 col-md-12"> 
				<div class="col-sm-2 col-md-2">
					<label class="m-label" for="remark">说明：</label>
				</div>
				<div class="col-sm-10 col-md-10">
					<textarea name="remark" id="remark" rows="" cols="" class="form-control m-input" disabled>${recodrVo.remark}</textarea>
				</div>
		    </div>
		</div>
		<div class="form-group row">
			<div class="col-sm-12 col-md-12"> 
				<div class="col-sm-2 col-md-2">
					<label class="m-label" for="fin_remark">原因：</label>
				</div>
				<div class="col-sm-10 col-md-10">
					<textarea name="fin_remark" id="fin_remark" rows="" cols="" class="form-control m-input" >${recodrVo.fin_remark}</textarea>
				</div>
		    </div>
		</div>
		<div class="form-group row">
			<div class="col-sm-6 col-md-6"> 
				<div class="col-sm-4 col-md-4">
					<label class="m-label">交易凭证：</label>
				</div>
				<div class="col-sm-8 col-md-8 out" id="uploadPic"><!-- 上传凭证显示区 -->
					<!-- <img alt="" src="" width="200" class="img-thumbnail uploadPic"
						data-large-url="" data-large-content="交易凭证" title="点击查看大图"> -->
				</div>
		    </div>
		</div>
		<tags:dialogFooter>
			<div id="financeButton">
				<button type="button" onclick="updatePubRepayStatus()" class="btn btn-info" >提交计划</button>
				<button type="reset" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</tags:dialogFooter>
	</div>
</form>
</tags:dialogBody>
<script type="text/javascript">
$(function(){
//	showImg();
	var voucher_picid = "${recodrVo.voucher_picID}";
	console.log(voucher_picid);
	showImg(voucher_picid);
});

function unrecordedAjaxSub(){
	MsgBox.confirm("确认提交","提交确认",function(){
		var status = $("#dk_status").val();
		if(status == "038001"){
			updatePubRepayStatus();
		}else{
			unrecordedAjax.send();
		}
	});
}

function updatePubRepayStatus(){
		var status = $("#dk_status").val();
		if(status == "038001"){
			var fin_remark = $("#fin_remark").val();
			$("#pubrepay_status").val("13");
			if(fin_remark == "" || fin_remark == null){
				new $.zui.Messager('请输入原因!', {
				    type: 'success',
				    time: 2000,
				    placement:'center'
				}).show();
				return false;
			}
		}else if(status == "038003"){
			$("#pubrepay_status").val("02");
		}
		var _data = $("#settleWithholdFinanceFrm").serializeObject();
		var noteLog = false;
		caiwuEditAjax.setData(_data);
		caiwuEditAjax.addParam("noteLog",noteLog);
		caiwuEditAjax.send();
}
</script>
</body>
</html>